package ua.edu.nuos.jeetraining2012.automator.process.mgmt.vo;

import javax.persistence.Entity;
import javax.persistence.Id;

/**
 * JEE Training 2012-2013.
 *
 * @author Alexandr Dibrivny
 *         Date: 15.06.13
 *         Time: 10:00
 */
@javax.persistence.IdClass(ua.edu.nuos.jeetraining2012.automator.process.mgmt.vo.AccountsprocesseslinkEntityPK.class)
@javax.persistence.Table(name = "accountsprocesseslink", schema = "public", catalog = "jeetraining_2012_automator_db")
@Entity
public class AccountsprocesseslinkEntity {
    private int accountId;

    @javax.persistence.Column(name = "account_id")
    @Id
    public int getAccountId() {
        return accountId;
    }

    public void setAccountId(int accountId) {
        this.accountId = accountId;
    }

    private int processId;

    @javax.persistence.Column(name = "process_id")
    @Id
    public int getProcessId() {
        return processId;
    }

    public void setProcessId(int processId) {
        this.processId = processId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        AccountsprocesseslinkEntity that = (AccountsprocesseslinkEntity) o;

        if (accountId != that.accountId) return false;
        if (processId != that.processId) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = accountId;
        result = 31 * result + processId;
        return result;
    }
}
